<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/04-then方法同步修改.js"></script>
</head>
<body>
    <script>
        let p = new Promise((resolve, reject)=>{
            // 1. resolve 执行成功的回调
            // resolve('ok');
            // 2. reject执行失败的回调
            // reject('err')

            // 异步的操作暂时不行
            setTimeout(()=>{
                resolve('ok');
            },1000);
        })
        console.log('p: ', p);

        p.then(value=>{
            console.log('成功: ',value);
        }, reason=>{
            console.log('失败: ',reason);
        })
    </script>
    
</body>
</html>